package ru.bytedog.oiot.counter.bot.util;

import org.apache.commons.lang3.StringUtils;
import org.junit.jupiter.api.Test;

import java.time.LocalDateTime;

import static org.junit.jupiter.api.Assertions.*;

class FormatterUtilsTest {

    @Test
    void formatDate() {
        assertEquals(StringUtils.EMPTY, FormatterUtils.formatDateTime(null));
        assertEquals(StringUtils.EMPTY, FormatterUtils.formatTime(null));

        LocalDateTime testTime = LocalDateTime.of(2024, 2, 20, 10, 12, 34);
        assertEquals("20.02 10:12", FormatterUtils.formatDateTime(testTime));
        assertEquals("10:12", FormatterUtils.formatTime(testTime));
    }
}